﻿using System;
using Moq;
using Prompts.ReportCatalog.Model;

namespace Test.Prompts.Infrastructure.Fakes
{
    public class FakeReportCatalogServiceClient
    {
        private readonly Mock<IReportCatalogServiceClient> _mock;
        private Action<ReportCatalogInfo> _callBack;

        public FakeReportCatalogServiceClient()
        {
            _mock = new Mock<IReportCatalogServiceClient>();

            _mock
                .Setup(m => m.GetReportCatalogInfoAsync(It.IsAny<Action<ReportCatalogInfo>>()))
                .Callback((Action<ReportCatalogInfo> callBack) => _callBack = callBack);
        }

        public void ExecuteGetReportCatalogInfoCallback(ReportCatalogInfo reportCatalogInfo)
        {
            _callBack(reportCatalogInfo);
        }

        public IReportCatalogServiceClient Object { get { return _mock.Object; } }
        public Mock<IReportCatalogServiceClient> Mock { get { return _mock; } }
    }
}
